package com.jxdinfo.hussar.example.mes.md.service.impl;

import java.util.List;

import com.jxdinfo.hussar.example.common.utils.DateUtils;
import com.jxdinfo.hussar.example.mes.md.dao.MdWorkstationLineMapper;
import com.jxdinfo.hussar.example.mes.md.domain.MdWorkstationLine;
import com.jxdinfo.hussar.example.mes.md.service.IMdWorkstationLineService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 产线管理Service业务层处理
 *
 * @author 常宝坤
 * @date 2024-04-11
 */
@Service
public class MdWorkstationLineServiceImpl implements IMdWorkstationLineService
{
    @Autowired
    private MdWorkstationLineMapper mdWorkstationLineMapper;

    /**
     * 查询产线管理
     *
     * @param lineId 产线管理主键
     * @return 产线管理
     */
    @Override
    public MdWorkstationLine selectMdWorkstationLineByLineId(Long lineId)
    {
        return mdWorkstationLineMapper.selectMdWorkstationLineByLineId(lineId);
    }

    /**
     * 查询产线管理列表
     *
     * @param mdWorkstationLine 产线管理
     * @return 产线管理
     */
    @Override
    public List<MdWorkstationLine> selectMdWorkstationLineList(MdWorkstationLine mdWorkstationLine)
    {
        return mdWorkstationLineMapper.selectMdWorkstationLineListCondition(mdWorkstationLine);
    }

    /**
     * 新增产线管理
     *
     * @param mdWorkstationLine 产线管理
     * @return 结果
     */
    @Override
    public int insertMdWorkstationLine(MdWorkstationLine mdWorkstationLine)
    {
        mdWorkstationLine.setCreateTime(DateUtils.getNowDate());
        return mdWorkstationLineMapper.insertMdWorkstationLine(mdWorkstationLine);
    }

    /**
     * 修改产线管理
     *
     * @param mdWorkstationLine 产线管理
     * @return 结果
     */
    @Override
    public int updateMdWorkstationLine(MdWorkstationLine mdWorkstationLine)
    {
        mdWorkstationLine.setUpdateTime(DateUtils.getNowDate());
        return mdWorkstationLineMapper.updateMdWorkstationLine(mdWorkstationLine);
    }

    /**
     * 批量删除产线管理
     *
     * @param lineIds 需要删除的产线管理主键
     * @return 结果
     */
    @Override
    public int deleteMdWorkstationLineByLineIds(Long[] lineIds)
    {
        return mdWorkstationLineMapper.deleteMdWorkstationLineByLineIds(lineIds);
    }

    /**
     * 删除产线管理信息
     *
     * @param lineId 产线管理主键
     * @return 结果
     */
    @Override
    public int deleteMdWorkstationLineByLineId(Long lineId)
    {
        return mdWorkstationLineMapper.deleteMdWorkstationLineByLineId(lineId);
    }
}
